package com.zut.common.enums;

import lombok.Getter;

@Getter
public enum StatusFlagEnum {
    DISABLE(1,"禁用"),
    ENABLE(0,"启用");

    private Integer code;
    private String desc;

    StatusFlagEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StatusFlagEnum getByCode(int codeVal) {
        for (StatusFlagEnum result : StatusFlagEnum.values()) {
            if (result.code==codeVal){
                return result;
            }
        }
        return null;
    }
}
